const { http } = uni.$u
import { stringify } from 'qs'

export const sidebarTaskList = (params) =>
  http.get(`api/sidebar/task/list`, { params })

export const sidebarTaskIgnore = (params, config = {}) =>
  http.post(`api/sidebar/task/ignore`, params, config)

export const sidebarTaskFeedback = (params, config = {}) =>
  http.post(`api/sidebar/task/feedback`, params, config)

export const sidebarTaskWorkeList = (params, config = {}) =>
  http.post(`api/sidebar/task/workerlist`, params, config)
export const getSignature = (params, config = {}) =>
  http.post(`api/sidebar/task/signature`, params, config)
export const initUser = (params, config = {}) =>
  http.post(`api/sidebar/Task/getuserinfo`, params, config)
export const agentsignature = (params, config = {}) =>
  http.post(`api/sidebar/task/agentsignature`, params, config)

//new api
export const sidebarCustomer = (params) =>
  http.get(`/api/sidebar/Customer/findToCustomer`, { params })

export const workerToFollowUp = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/workerToFollowUp`, params, config)

export const findWorkerGroup = (params) =>
  http.get(`/api/sidebar/Customer/findWorkerGroup?${stringify(params)}`, params)

export const findWorker = (params) =>
  http.get(`/api/sidebar/Customer/findWorker`, { params })

export const getDynamicList = (params) =>
  http.get(`/api/sidebar/Customer/findDynamic?${stringify(params)}`, params)

export const getFollwList = (params) =>
  http.get(`/api/sidebar/Customer/followList?${stringify(params)}`, params)

export const getOrderList = (params) =>
  http.get(`/api/sidebar/Customer/orderList?${stringify(params)}`, params)

export const getFieldInfoList = (params) =>
  http.get(`/api/sidebar/Customer/getFieldInfo?${stringify(params)}`, params)
export const getAfterSaleList = (params) =>
  http.get(`/api/sidebar/Customer/aftersaleList?${stringify(params)}`, params)

export const getSearchGroup = (params) =>
  http.get(`/api/sidebar/Customer/searchGroup?${stringify(params)}`, params)

export const getWorkerAll = (params) =>
  http.get(`/api/sidebar/Customer/findWorker?${stringify(params)}`, params)

export const getWorker = (params) =>
  http.post(`/api/sidebar/Customer/getWorker`, params)

export const getTodoList = (params) =>
  http.get(`/api/sidebar/Customer/TodoList?${stringify(params)}`, params)

//标签列表
export const getTagsList = (params) =>
  http.get(`/api/sidebar/Customer/tags?${stringify(params)}`, { params })

//添加标签
export const editTags = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/editTags`, params, config)

export const saveCustomerInfo = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/saveCustomerInfo`, params, config)

//所有员工
export const getWorkerAllList = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/getWorkerAll`, params, config)
//创建待办
export const workerTodo = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/workerTodo`, params, config)

//完成待办
export const completeTodo = (params, config = {}) =>
  http.post(`/api/sidebar/Customer/completeTodo`, params, config)
